/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.common.service.api;

import com.koron.common.bean.StaffBean;
import com.koron.common.domain.AttachmentBean;
import com.koron.common.domain.MultipartFileParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @author sxx
 * @since 2020-03-17
 */
public interface AttachmentUploadService {

    /**
     * 附件上传
     * @param file
     * @return
     */

    Map uploadAttach(StaffBean userBean, String deleteId, String businessId, MultipartFile[] file);

    List<AttachmentBean> getAttachListByModel(String id, String attModel);

    Integer uploadFiles(StaffBean userBean, String businessId, MultipartFile[] files);

    Integer uploadFilesByModel(StaffBean userBean, String businessId, MultipartFile[] files,String attModel);

    Integer deleteFiles(StaffBean userBean ,String businessId , String deleteIds);

    /**
     * 上传分片文件方法1
     * @param param
     * @throws IOException
     */
    //void uploadFileRandomAccessFile(MultipartFileParam param) throws IOException;

    /**
     * 上传分片文件方法2
     * 处理文件分块，基于MappedByteBuffer来实现文件的保存
     * @param param
     * @throws IOException
     */
    boolean uploadFileByMappedByteBuffer(StaffBean userBean, MultipartFileParam param) throws Exception;


}